/**
 * @author：anlzou
 * @Date：Created in21:28 2021/3/28
 * @Github：https://github.com/anlzou
 * @Description：
 */
package com.anlzou.demo.classTest.stream;

import javax.swing.text.html.HTMLDocument;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

public class SquareElementOfArrays {
    List<Integer> arrays;// = new ArrayList<Integer>();

    public SquareElementOfArrays(List<Integer> arrays){
        this.arrays = arrays;
    }

    public void printElementSquare(){
        // 获取对应的平方数
        Iterator iterator = arrays.iterator();
        while (iterator.hasNext()){
            Integer num = (Integer) iterator.next();
            System.out.println(num*num);
        }
    }
}
